package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerResourceAddLog implements IQLResponse
{
    /// <summary>
    /// 玩家Id
    /// </summary>
    public long UserId;

    /// <summary>
    /// 昵称
    /// </summary>
    public String Nickname;

    /// <summary>
    /// 资源类型 1携带资源 2金库资源
    /// </summary>
    public long ResourceType;

    /// <summary>
    /// 物品Id
    /// </summary>
    public long ItemId;

    /// <summary>
    /// 物品子Id
    /// </summary>
    public long ItemSubId;

    /// <summary>
    /// 物品名称
    /// </summary>
    public String ItemName;

    /// <summary>
    /// 修改的量
    /// </summary>
    public long Delta;

    /// <summary>
    /// 影响的数量
    /// </summary>
    public long AffectAmount;

    /// <summary>
    /// 操作员
    /// </summary>
    public String Operater;

    /// <summary>
    /// 创建时间
    /// </summary>
    public String CreateTime;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj;
        if (t.has("user_id"))
            UserId = t.getLong("user_id");
        if (t.has("nickname"))
            Nickname = t.getString("nickname");
        if (t.has("resource_type"))
            ResourceType = t.getLong("resource_type");
        if (t.has("item_id"))
            ItemId = t.getLong("item_id");
        if (t.has("item_sub_id"))
            ItemSubId = t.getLong("item_sub_id");
        if (t.has("item_name"))
            ItemName = t.getString("item_name");
        if (t.has("delta"))
            Delta = t.getLong("delta");
        if (t.has("affect_amount"))
            AffectAmount = t.getLong("affect_amount");
        if (t.has("operater"))
            Operater = t.getString("operater");
        if (t.has("create_time"))
            CreateTime = t.getString("create_time");
    }
}
